package com.ruoyi.common.utils.id;

import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;

/**
 * Desc     id生成
 * Project  ry-wms
 * Package  com.ruoyi.common.utils.id
 * Author   zhangyunlong@prevailcloud.com
 * Date     2023/2/2
 */
public abstract class IdGenarator
{
    private static final Snowflake snowflake = IdUtil.getSnowflake(1, 1);

    public static Snowflake snowflake()
    {
        return IdGenarator.snowflake;
    }

    public static Long nextId()
    {
        return IdGenarator.snowflake.nextId();
    }

    public static String nextIdStr()
    {
        return IdGenarator.snowflake().nextIdStr();
    }
}
